package priv.yiyuan.example.design.visitor.decorator;

import priv.yiyuan.example.design.visitor.ConfigurationVisitor;
import priv.yiyuan.example.design.visitor.DatabaseConfig;
import priv.yiyuan.example.design.visitor.NetworkConfig;

/**
 * 实际装饰者实现类，安全检查装饰器
 *
 * @author YiYuan
 * @data 2025/8/4
 * @apoNote
 */
public class SecurityCheckVisitorDecorator extends ConfigurationVisitorDecorator {

    public SecurityCheckVisitorDecorator(ConfigurationVisitor decoratedVisitor) {
        super(decoratedVisitor);
    }

    @Override
    public void visit(DatabaseConfig element) {

        System.out.println("Security Check: Performing check for Database Config...");
        super.visit(element);
        System.out.println("Security Check: Database Config check passed.");
    }

    @Override
    public void visit(NetworkConfig element) {

        System.out.println("Security Check: Performing check for Network Config...");
        super.visit(element);
        System.out.println("Security Check: Network Config check passed.");

    }
}
